<template>
  <div>
    <el-button class="add" type="primary" @click="handleAdd()"
      >+新增工资项</el-button
    >
    <el-table :data="grades">
      <el-table-column
        prop="gradeCode"
        label="工资项名称"
        align="center"
      ></el-table-column>
      <el-table-column
        prop="gradeName"
        label="工资标准"
        align="center"
      ></el-table-column>
      <el-table-column label="操作" prop="createTime" align="center">
        <template slot-scope="scope">
          <span class="org-oper">
            <el-link size="mini" type="primary" @click="handleUpdate()"
              >修改</el-link
            >
            <el-link
              size="mini"
              type="danger"
              @click="handleDelete(scope.row)"
              v-hasPermi="['organization:grade:remove']"
              >删除</el-link
            >
          </span>
        </template>
      </el-table-column>
    </el-table>
    <add-payroll :addDialog="addDialog" @close="closeAddDialog"></add-payroll>
  </div>
</template>

<script>
import addPayroll from './addPayroll.vue'
export default {
    name:'wageItem',
    components:{
        addPayroll
    },
  data() {
    return {
    addDialog:false,
      grades: [
        {
          gradeCode: "基本工资",
          gradeName: "点击查看",

        },
      ],
    };
  },
  methods:{
      handleAdd(){
          this.addDialog=true;
      },
      handleUpdate(){
          this.addDialog=true;
      },
      closeAddDialog(params){
          this.addDialog=params
      }
  }
};
</script>

<style scoped>
.el-link {
  margin: 0 10px;
}
.add {
  margin: 20px;
}
</style>